<template>
	<el-drawer title="公文委托详情" v-model="visible" :size="400" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-form-item label="选择公文" prop="flowId">{{form.flowName}}
					</el-form-item>
					<el-form-item label="开始时间" prop="beginTime">{{form.beginTime}}
					</el-form-item>
					<el-form-item label="结束时间" prop="endTime">{{form.endTime}}
					</el-form-item>
					<el-form-item label="受托人" prop="toId">{{form.toUserName}}
					</el-form-item>
					<el-form-item label="是否启用">
						<el-tag v-if="form.status=='0'">禁用</el-tag>
						<el-tag v-if="form.status=='1'">启用</el-tag>
					</el-form-item>
					<el-form-item label="备注" prop="remark">{{form.remark}}
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
export default {
	emits: ['success', 'closed'],
	components: {
	},
	data() {
		return {
			loading: false,
			form: {
				flowId:"",
				beginTime: "",
				endTime: "",
				toId:"",
				status:"1",
				remark: "",
				msgType:"",
			},

			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(){
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data){
			this.form.flowName = data.flowName
			this.form.beginTime = data.beginTime
			this.form.endTime = data.endTime
			this.form.toUserName = data.toUserName
			this.form.status = data.status
			this.form.remark = data.remark
			this.form.msgType = data.msgType
		},
		async getBpmDelegateById(data)
		{
			let res = await this.$API.bpm.bpmDelegate.getBpmDelegateById.get({delegateId:data});
			{
				if(res.code==200)
				{
					this.form.flowName = res.data.flowName
					this.form.beginTime = res.data.beginTime
					this.form.endTime = res.data.endTime
					this.form.toUserName = res.data.toUserName
					this.form.status = res.data.status
					this.form.remark = res.data.remark
					this.form.msgType = res.data.msgType
				}else
				{
					this.$alert(res.message, "提示", {type: 'error'})
				}
			}
		}
	}
}
</script>

<style>
</style>
